<template>
	<el-dialog :title="form.modelName" v-model="open" width="800px" @open="initOpen" append-to-body :before-close="close"
		@close="close">
		<!-- <p class="dialogTitle">{{form.modelName}}</p> -->
		<el-form ref="MaterialRef" :model="form" label-width="120px">
			<el-row>
				<el-col :span="12">
					<el-form-item label="模型名称" prop="modelName">
						{{form.modelName}}
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="是否默认" prop="">
						{{form.isDefault=='0'?'否':'是'}}
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="地区" prop="">
						{{form.province}} - {{form.city}}
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="维护人" prop="">
						{{form.createUserName}}
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="维护人单位" prop="">
						{{form.orgName}}
					</el-form-item>
				</el-col>
			</el-row>
			<el-divider border-style="dashed"></el-divider>
			<el-row>
				<el-col :span="6" class="tab-title">
					救援物资需求模型
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="20" :offset="2">

					救援物资需求包括帐篷需求、担架需求、棉被需求、食品需求、饮水需求、临时厕所需求、临时浴室需求。<br /><br />

					1）帐篷(顶)=帐篷计算系数 ×（总待安置人数-灾区范围内应急避难场所可容纳人数）× 季节系数<br /><br />

					帐篷计算系数为{{form.ratio1}}，季节系数{{form.ratio2}}：春季（1）、夏季（0.8）、秋季（1）、冬季（1.2），应急避难场所可容纳人数使用基础数据应急避难场所空间数据计算。<br /><br />

					2）担架需求：地震中伤员运送最好的工具之一是担架，一付担架平均可以运送{{form.ratio6}}个伤员。<br /><br />

					3）棉被需求：救灾棉被按照每{{form.ratio7}}个需安置人员一床棉被来供应。<br /><br />

					4）食品需求：救灾食品按照每需安置人员人{{form.ratio8}}公斤来准备。<br /><br />

					5）饮水需求：应急期清洁饮水按照受灾人口每人每天{{form.ratio9}}公斤计算，连续供应{{form.ratio10}}天。<br /><br />

					6）临时厕所需求：临时厕所数目为受灾人口的{{form.ratio11}}。<br /><br />

					7）临时浴室需求：临时浴室是临时厕所的{{form.ratio12}}。<br /><br />

				</el-col>
			</el-row>
			<el-row>
				<el-col :span="6" class="tab-title">
					医疗资源需求模型
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="20" :offset="2">

					资料资源需求包括病房需求、病床需求、手术用血浆需求。<br /><br />

					1）病房需求，按照每位伤员需要{{form.ratio13}}平方米计算。<br /><br />

					2）病床需求，按每{{form.ratio14}}位伤员需要一张病床计算。<br /><br />

					3）手术用血浆，按平均每位伤员{{form.ratio15}}毫升计算。<br /><br />

				</el-col>
			</el-row>
		</el-form>
		<template #footer>
			<div class="dialog-footer">
				<el-button type="primary" @click="close">关闭</el-button>
			</div>
		</template>
	</el-dialog>
</template>
<script setup>
import { getMaterialConomicModelById } from '@/api/earthquakeLossesEstimation/earthquakeSetting'

const props = defineProps({
	open: Boolean,
	id: {
		type: String,
		default: ''
	}
})
const emits = defineEmits(['update:open'])
const data = reactive({
	form: {
		modelName: '',
		isDefault: '',
		province: '',
		city: '',
		createUserName: '',
		orgName: ''
	}
})
const { form } = toRefs(data)
// 查询模型详情
const getModelDetail = () => {
	getMaterialConomicModelById(props.id).then(res => {
		if (res.code == 200) {
			res.data && (form.value = res.data)
		}
	})
}

const initOpen = () => {
	getModelDetail()
}
const close = () => {
	emits('update:open', false)
}
</script>
<style scoped lang="scss">
.el-form {
	padding-top: 20px;
	.el-form-item {
		margin-bottom: 0;
	}
}

.tab-title {
	font-size: 16px;
	font-weight: bold;
	border-left: 4px solid var(--el-color-primary);
	font-family: PingFangSC-Medium;
	padding-left: 10px;
	margin-bottom: 20px;
}
</style>